import React, { Component } from 'react';
import PropTypes from 'prop-types';

import Todo from './Todo';

const TodoList = ({todos, onTodoClick}) => (
    <ul>
        {todos.map(
            (todo) => {
                return (
                    <Todo key={todo.id} onClick={onTodoClick} {...todo}/>
                );
            }
        )}
    </ul>
);


export default TodoList;
